import request from "@/utils/request";

// 获取任务列表（分页）
export function getAllList(query,type) {
  //type 0:新建的评估子区   1:重新划定的评估子区
  return request({
    url: `/surTaskManage/getPage/${query.xsemId}/${type}`,
    method: "get",
    params: query,
  });
}

// 获取任务列表（全部）
export function getAllTaskDataList(query,type) {
  //type 0:新建的评估子区   1:重新划定的评估子区
  return request({
    url: `/surTaskManage/getAllData/${query.xsemId}/${type}`,
    method: "get",
    params: query,
  });
}

// 获取小组列表
export function getAllList1(query) {
  return request({
    url: "/investigationGroup/getPage",
    method: "get",
    params: query,
  });
}

// 查看调查组
export function getDetail1(id) {
  return request({
    url: "/investigationGroup/findById",
    method: "get",
    params:id
  });
}

// 获取task创建人信息
export function getTaskCreateInfo(id) {
  return request({
    url: "/surTaskManage/getCode",
    method: "get",
    params:id
  });
}

// 查看
export function getDetail(id) {
  return request({
    url: "/surTaskManage/findById",
    method: "get",
    params:id
  });
}

// 保存
export function saveData(data) {
  return request({
    url: "/surTaskManage/save",
    method: "post",
    data:data
  });
}

// 修改
export function updateData(data) {
  return request({
    url: "/surTaskManage/update",
    method: "post",
    data:data
  });
}

//删除
export function del(id) {
  return request({
    url: "/surTaskManage/delete/"+id,
    method: "post",
  });
}

// 获取抽样点列表（分页）
export function getAllList2(query) {
  return request({
    url: `/samPoiData/getPage`,
    method: "get",
    params: query,
  });
}

// 获取抽样点列表（全部）
export function getAllSamPoiDataList(query) {
  return request({
    url: "/samPoiData/getAllData",
    method: "get",
    params: query,
  });
}

// 获取task创建人信息
export function getPointCreateInfo2(id) {
  return request({
    url: "/samPoiData/getSamPoiCode",
    method: "get",
    params:id
  });
}

// 查看
export function getDetail2(id) {
  return request({
    url: "/samPoiData/findById",
    method: "get",
    params:id
  });
}

// 保存
export function saveData2(data) {
  return request({
    url: "/samPoiData/save",
    method: "post",
    data:data
  });
}

// 修改
export function updateData2(data) {
  return request({
    url: "/samPoiData/update",
    method: "post",
    data:data
  });
}

//删除
export function del2(id) {
  return request({
    url: "/samPoiData/delete/"+id,
    method: "post",
  });
}
// 查看
export function getUnassociatedData(params) {
  return request({
    url: "/samPoiData/getUnassociatedData",
    method: "get",
    params
  });
}
// 根据id差任务
export function findById(params) {
  return request({
    url: "/invTaskManage/findById",
    method: "get",
    params: params
  });
}
// 获取任务编号
export function getCode() {
  return request({
    url: "/invTaskManage/getCode",
    method: "get",
  });
}
export function getAdministrativeDivisionByGeomText(data) {
  return request({
    url: "/invTaskManage/getAdministrativeDivisionByGeomText",
    method: "post",
    data
  });
}

// 保存
export function savePolygon(data) {
  return request({
    url: "/invTaskManage/save",
    method: "post",
    data:data
  });
}
// 修改
export function updatePolygon(data) {
  return request({
    url: "/invTaskManage/update",
    method: "post",
    data:data
  });
}
//删除
export function deletePolygon(id) {
  return request({
    url: "/invTaskManage/delete/"+id,
    method: "post",
  });
}
//地图获取行政区划树列表
export function getAreaTree() {
  return request({
      url: '/fxfz/sArea/getAreaTree',
      method: 'get'
  })
}
//地图获取行政区划树列表
export function getInvGroupListByXsemId(params) {
  return request({
      url: '/investigationGroup/getInvGroupListByXsemId',
      method: 'get',
      params
  })
}
// 调查任务组保存
export function accTotheGroupSave(data) {
  return request({
    url: "/invTaskManage/accTotheGroupSave",
    method: "post",
    data:data
  });
}
//
export function getPageTask(params) {
  return request({
      url: '/invTaskManage/getPage/' + params.xsemId,
      method: 'get',
      params
  })
}
//
export function getTaskList(params) {
  return request({
      url: '/invTaskManage/getTaskList',
      method: 'get',
      params:params
  })
}
export function deleteByXsemId(xsemId) {
  return request({
    url: "/invTaskManage/deleteByXsemId/" + xsemId,
    method: "post",
  });
}

